CREATE TABLE [agency].[ConfigurationType]
(
[ConfigurationTypeId] [int] NOT NULL IDENTITY(1, 1),
[Name] [nvarchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Code] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ParentConfigurationTypeId] [int] NULL,
[Active] [bit] NOT NULL,
[Deleted] [bit] NOT NULL,
[CreatedBy] [int] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [int] NULL,
[ModifiedOn] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
ALTER TABLE [agency].[ConfigurationType] ADD
CONSTRAINT [FK_ConfigurationType_ConfigurationType] FOREIGN KEY ([ParentConfigurationTypeId]) REFERENCES [agency].[ConfigurationType] ([ConfigurationTypeId])
GO
ALTER TABLE [agency].[ConfigurationType] ADD CONSTRAINT [PK_ConfigurationType] PRIMARY KEY CLUSTERED  ([ConfigurationTypeId]) ON [PRIMARY]
GO
